<form action="index.php" method="post" name="adminForm">
<script>
  jQuery(document).ready(
    function() {
      create_tab("#tabs");
      
      var hash = jQuery(location).attr("hash");
      if(hash != '')
        jQuery('#tabs ul li a[href="' + hash + '"]').click();
    }
  );
</script>

<div id="tabs" style="padding-top:10px;">
  <ul>
  <?  if($this->divisions): ?>
    <? foreach($this->divisions as $division): ?>
      <li><a href="#conference-<?= $division->id ?>"><?= $division->name ?></a></li>
    <? endforeach; ?>
  <?  endif; ?>
  </ul>    

  <?  if($this->divisions):
      foreach($this->divisions as $division):  ?>
      <div id="conference-<?= $division->id ?>">
      <?  foreach($division->conferences as $conference): ?>
        <h3><?= $conference->name ?></h3>
        <ul class="list">
        <? $num = 1; ?>
        <? foreach($conference->teams as $team): ?>
          <? if($num > 3) $num = 1; ?>
          <? $link = JRoute::_('index.php?option=com_pbny&controller=teams&task=display_team&id='.$team->id);  ?>
          <li class="item<?= $num ?>">
            <a href="<?= $link?>"><?= $team->name ?></a>
            (<?= $team->abbr ?>)
          </li>
          <? $num++; ?>
        <? endforeach; ?>
        </ul>
        <div class="clear" style="padding-bottom:30px"></div>
      <? endforeach; ?>
      </div>
  <?    endforeach; 
    endif;
  ?>

</div>

</form>
